package com.zhouyu.service;

import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SmartInitialImplementsService implements SmartInitializingSingleton {

	@Autowired
	private OrderService orderService;

	public void test(){
		System.out.println(orderService);
	}


	@Override
	public void afterSingletonsInstantiated() {
		//所有非懒加载的单利bean都创建完之后，才会进行一个一个单利bean来进行调用
		// 调用每个单例bean的这个方法
		System.out.println("所有非懒加载的单利bean都创建完之后，才会进行一个一个单利bean来进行调用");
	}
}
